package JUnit;

import static org.junit.Assert.*;

import java.util.ArrayList;

import org.junit.Test;

import Model.CaptainsLog;

public class TimCaptainsLogTest {

	@Test
	public void testPublish() {
		CaptainsLog log = new CaptainsLog();
		String testString = "Hello";
		
		log.publish(testString);
		
		
		assertEquals(log.getEntries().get(0), testString);
		
		log.publish("1");
		log.publish("2");
		log.publish("3");
		log.publish("4");
		log.publish("5");
		log.publish("6");
		log.publish("7");
		log.publish("8");
		log.publish("9");
		
		assertEquals(log.getEntries().get(9), "9");
		
		String wrap = "Wrap Around";
		log.publish(wrap);
		
		//Test to see if data wraps around and overwrites old data once cap has been reached
		assertEquals(log.getEntries().get(0), wrap);
	}

}
